From: Giovanni Campagna Date: Sat, 19 Jan 2013 17:49:55 +0000 (+0100) Subject: MessageTray: simplify image handling X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5051 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=484ef5f2f66edea92e831b0dcde31dd3fb07bf99;p=gnome-shell.git MessageTray: simplify image handling Remove duplicate checks before calling unsetImage, and set properties directly in the constructor. https://bugzilla.gnome.org/show_bug.cgi?id=692091 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index bc9bb78f0..d33b80c45 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -429,7 +429,7 @@ const Notification = new Lang.Class({ this._actionArea = null; this._buttonBox = null; } - if (this._imageBin && params.clear) + if (params.clear) this.unsetImage(); if (!this._scrollArea && !this._actionArea && !this._imageBin) @@ -609,13 +609,14 @@ const Notification = new Lang.Class({ }, setImage: function(image) { - if (this._imageBin) - this.unsetImage(); + this.unsetImage(); + if (!image) return; - this._imageBin = new St.Bin(); - this._imageBin.child = image; - this._imageBin.opacity = 230; + + this._imageBin = new St.Bin({ opacity: 230, + child: image }); + this._table.add_style_class_name('multi-line-notification'); this._table.add_style_class_name('notification-with-image'); this._addBannerBody();